<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="">
    
    <title>首页</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="../../js/jquery-3.3.1.js"></script>
	<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
	<link href="../../css/bootstrap.min.css" rel="stylesheet">
  </head>
  
  <body>
  <script type="text/javascript">
  	$(document).ready(function(){
  		var url = GetRequest();
  		$.ajax({url:"${pageContext.request.contextPath}/student/findDetail",
  		data:{sid:url.sid},
  		dataType:"json",
  		type:"post",
  		success:function(data, status){
  			$("#t").append("<tr>");
  			$("#t").append("<td>"+data.data.sname+"</td>"); 
  			$("#t").append("<td>"+data.data.major.college.ename+"</td>");
  			$("#t").append("<td>"+data.data.major.mname+"</td>");
  			$("#t").append("</tr>");
  		}});
  	});
  	
  	
  	function GetRequest() {   
   		var url = location.search; //获取url中"?"符后的字串   
   		var theRequest = new Object();   
   		if (url.indexOf("?") != -1) {   
     		 var str = url.substr(1);   
      		strs = str.split("&");   
      		for(var i = 0; i < strs.length; i ++) {   
         		theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);   
      		}   
   		}   
  		return theRequest;   
	} 
  </script>
  
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<h3 class="text-center">
				详细信息
			</h3>
			<br/>
			<div class="col-md-6 column">
			 <button type="button" class="btn btn-sm">编辑</button>
			</div>
			<div class="col-md-6 column">
			</div>
			<br/>
			<table class="table table-bordered table-hover">
				<thead>
					<tr>
						<th>
							姓名
						</th>
						<th>
							学院
						</th>
						<th>
							专业
						</th>
					</tr>
				</thead>
				<tbody id="t">
			
				</tbody>
			</table>
		</div>
	</div>
</div>
  </body>
</html>
